<?php
include LIB_PATH . '/YAction.class.php';
class SettingAction extends YAction {
	public function __construct() {
		parent::__construct();
	}
	
	public function index() {
		$data = SysUtil::loadConfig('common_config.php', './Core');
		$this->assign('data', $data);

		$this->display();
	}
	
	public function email() {
		$data = SysUtil::loadConfig('mail.conf.php', './Core');
		$this->assign('data', $data);

		$this->display();
	}
	public function ajax_testEmail() {
		include LIB_PATH . '/MailAction.class.php';
		$data = array(
			'host' => y_getParam('host'),
			'port' => y_getParam('port'),
			'username' => y_getParam('username'),  // 发邮件的邮箱用户名
			'password' => y_getParam('password'),  // 邮箱密码
			'sender_email' => y_getParam('sender_email'),  // 显示用 给收件人看
			'sender_name' => y_getParam('sender_name')  // 显示用 给收件人看
		);
		
		$postto = y_getParam('postto');
		$content = y_getParam('content');
		$mail = new MailAction($data);
		$r = $mail->sendMail($postto, '测试邮件', $content);
		
		echo 1;
	}
	
	public function seo() {
		$data = SysUtil::loadConfig('seo_conf.php', './Public');
		$this->assign('data', $data);

		$this->display();
	}
}